﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/Elysium;component/Themes/Generic.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <!-- Separator -->
    <Style TargetType="{x:Type Separator}">
        <Setter Property="Background" Value="{StaticResource MiddleLightBrush}"/>
        <Setter Property="Margin" Value="0"/>
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Separator}">
                    <Border Background="{TemplateBinding Background}" 
                            BorderBrush="{TemplateBinding BorderBrush}" 
                            BorderThickness="{TemplateBinding BorderThickness}" 
                            Height="1" 
                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="HorizontalSeparatorStyle" BasedOn="{StaticResource {x:Type Separator}}" TargetType="{x:Type Separator}"/>

    <Style x:Key="VerticalSeparatorStyle" BasedOn="{StaticResource {x:Type Separator}}" TargetType="{x:Type Separator}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Separator}">
                    <Border Background="{TemplateBinding Background}" 
                            BorderBrush="{TemplateBinding BorderBrush}" 
                            BorderThickness="{TemplateBinding BorderThickness}" 
                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                            Width="1" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Drag Separator - Used by Drag and Drop -->
    <Style x:Key="HorizontalDragSeparatorStyle" TargetType="{x:Type Separator}">
        <Setter Property="BorderBrush" Value="{StaticResource LowlightBrush}"/>
        <Setter Property="BorderThickness" Value="2"/>
        <Setter Property="Margin" Value="0, -8, 0, -8"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Separator}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Path Data="M 0,0L 1,0.5L 0,1L 0,1 Z" 
                              Height="16"
                              SnapsToDevicePixels="True"
                              Stretch="Uniform"
                              Stroke="{Binding Path=BorderBrush, RelativeSource={RelativeSource AncestorType=Separator}}"
                              StrokeThickness="{Binding Path=BorderThickness.Left, RelativeSource={RelativeSource AncestorType=Separator}}"
                              Width="16"/>
                        <Line Grid.Column="1"  
                              Margin="-1, 0, -1, 0"
                              SnapsToDevicePixels="True" 
                              Stretch="Fill"
                              Stroke="{Binding Path=BorderBrush, RelativeSource={RelativeSource AncestorType=Separator}}"
                              StrokeThickness="{Binding Path=BorderThickness.Left, RelativeSource={RelativeSource AncestorType=Separator}}"
                              X1="0" Y1="0" 
                              X2="1" Y2="0"/>
                        <Path Grid.Column="2" 
                              Data="M 0,0.5L 1,0L 1,1L 1,1 Z"
                              Height="16"
                              SnapsToDevicePixels="True"
                              Stretch="Uniform"
                              Stroke="{Binding Path=BorderBrush, RelativeSource={RelativeSource AncestorType=Separator}}"
                              StrokeThickness="{Binding Path=BorderThickness.Left, RelativeSource={RelativeSource AncestorType=Separator}}"
                              Width="16"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style x:Key="VerticalDragSeparatorStyle" TargetType="{x:Type Separator}">
        <Setter Property="BorderBrush" Value="{StaticResource LowlightBrush}"/>
        <Setter Property="BorderThickness" Value="2"/>
        <Setter Property="Margin" Value="-8, 0, -8, 0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Separator}">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Path Data="M 0,0L 1,0L 0.5,1L 0.5,1 Z" 
                              Height="16"
                              SnapsToDevicePixels="True"
                              Stretch="Uniform"
                              Stroke="{Binding Path=BorderBrush, RelativeSource={RelativeSource AncestorType=Separator}}"
                              StrokeThickness="{Binding Path=BorderThickness.Left, RelativeSource={RelativeSource AncestorType=Separator}}"
                              Width="16"/>
                        <Line Grid.Row="1"  
                              Margin="0, -1, 0, -1"
                              SnapsToDevicePixels="True" 
                              Stretch="Fill"
                              Stroke="{Binding Path=BorderBrush, RelativeSource={RelativeSource AncestorType=Separator}}"
                              StrokeThickness="{Binding Path=BorderThickness.Left, RelativeSource={RelativeSource AncestorType=Separator}}"
                              X1="0" Y1="0" 
                              X2="0" Y2="1"/>
                        <Path Grid.Row="2" 
                              Data="M 0.5,0L 1,1L 0,1L 0,1 Z"
                              Height="16"
                              SnapsToDevicePixels="True"
                              Stretch="Uniform"
                              Stroke="{Binding Path=BorderBrush, RelativeSource={RelativeSource AncestorType=Separator}}"
                              StrokeThickness="{Binding Path=BorderThickness.Left, RelativeSource={RelativeSource AncestorType=Separator}}"
                              Width="16"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>